Linux: gate WSC source files and zlib system deps on HC_NOWEBSOCKETS/HC_NOZLIB#992
Merged
Merged
Conversation
…HC_NOZLIB After #965, websocketpp_websocket.cpp was added to LINUX_SOURCE_FILES unconditionally and install_dependencies.bash installed zlib1g/zlib1g-dev unconditionally. Consumers opting out via HC_NOWEBSOCKETS or HC_NOZLIB still paid the build/dep cost. - CMakeLists.txt: gate websocketpp_websocket.{cpp,h} + x509_cert_utilities.hpp on NOT DEFINED HC_NOWEBSOCKETS (matches existing HC_NOZLIB gating pattern at line 89). - install_dependencies.bash: skip zlib1g/zlib1g-dev when HC_NOZLIB=true or HC_NOWEBSOCKETS=true (compression cannot run without zlib, and websockets are the only consumer of compression). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
option(HC_NOWEBSOCKETS ...) at line 10 always defines the variable, so 'if (NOT DEFINED HC_NOWEBSOCKETS)' was always false and the websocketpp sources never got appended. Match the truthy-check pattern already used at line 201 (HC_ENABLE_WEBSOCKET_COMPRESSION AND NOT HC_NOWEBSOCKETS). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
v-patrickpe
commented
Jun 8, 2026
v-patrickpe
left a comment
Contributor
Author
There was a problem hiding this comment.
Hey @jasonsandlin! LHC pair is ready when you are:
- #991 (GDK ASIO per-file def): green, no reviews yet
- #992 (this PR, Linux WSC/zlib deps gate): pushed 99671ef fixing the CMake gate (
option()on L10 always defines HC_NOWEBSOCKETS, soif (NOT DEFINED ...)never fires; switched to truthy check matching L201). CI re-running.
Let me know if your WSC design changes the shape of #992.
jasonsandlin
approved these changes
Jun 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses the first two checklist items in #989.
After #965, Linux consumers opting out of WebSockets (
HC_NOWEBSOCKETS) or zlib (HC_NOZLIB) still paid the cost of buildingwebsocketpp_websocket.cppand installingzlib1g/zlib1g-devsystem packages.Changes
Build/libHttpClient.Linux/CMakeLists.txt— wrapwebsocketpp_websocket.{cpp,h}+x509_cert_utilities.hppaddition toLINUX_SOURCE_FILESinif (NOT DEFINED HC_NOWEBSOCKETS). Matches the existing pattern at line 89 (if (NOT DEFINED HC_NOZLIB)guards the zlib source list).Build/libHttpClient.Linux/install_dependencies.bash— skipzlib1g/zlib1g-devwhenHC_NOZLIB=trueorHC_NOWEBSOCKETS=true. WSC is the only consumer of zlib on Linux, so both opt-outs make zlib unnecessary. Build toolchain deps (clang/make/autoconf/automake/libtool) are unchanged.Validation
install_dependencies.bashdefault behavior unchanged when neither env var is set.--checkmode adapts automatically (loops over the samelibrary_dependenciesarray, which is empty in the opt-out case).Not in this PR (tracked in #989)
HC_ENABLE_WEBSOCKET_COMPRESSIONtoggle (hard-coded=1in pbxproj).HCEnableWebSocketCompression=trueandboost-wintlssubmodule is missing.%(PreprocessorDefinitions)per-file-override audit (one instance fixed in GDK: add ASIO_DISABLE_SERIAL_PORT to per-file websocketpp_websocket.cpp defines (follow-up to #987) #988).Resolves first two boxes of #989.
Re-opened on upstream repo (was: #990 from fork; closed per @rgomez391's request to enable ADO CI auto-trigger).